package cn.pn.project.service;

import cn.pn.project.mapper.base.AddressDao;
import cn.pn.project.pojo.base.Address;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 提供者：base模块提供Order(xyx)
 */
@RestController
public class RestPnBaseOrder{

    @Autowired
    private AddressDao addressDao;

    /**
     * 根据地址主键id查询地址信息(xyx)
     * @RequestParam param
     * @return
     * @throws Exception
     */
    @PostMapping("/getAddressById")
    public Address getAddressById(@RequestParam(value = "addressId",required = false) Integer addressId)throws Exception{
        System.out.println("**********************************根据地址主键id查询地址信息");
        System.out.println("**********************************addressId="+addressId);
        return addressDao.findAddressByAddressId(addressId);
    }
}
